<template>
  <div class="link-wrap flex-row-start" @click="handleClick">
    <img class="link-wrap-icon" src="../../images/link-icon.png" alt="" />
    <div class="link-wrap-text">
      {{ text }}
    </div>
  </div>
</template>

<script lang="ts" setup>
const props = withDefaults(
  defineProps<{
    text?: string
    href?: string
  }>(),
  {
    text: '',
    href: '',
  },
)

const handleClick = () => {
  if (props.href) window.open(props.href, '_blank')
}
</script>

<style lang="scss" scoped>
.link-wrap {
  height: vh(18);
  margin-top: vh(24);

  &-icon {
    width: vw(16);
  }

  &-text {
    margin-left: vw(8);
    text-decoration: underline;
    cursor: pointer;

    &:hover {
      color: var(--big-screent-hover-color);
    }
  }
}
</style>
